package com.dzjcloud.dzj.common.fegin.config;

import feign.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Scope;
import feign.form.spring.SpringFormEncoder;
import feign.codec.Encoder;


/**
 * <h3>dzj-cloud</h3>
 * <p>文件传输配置</p>
 *
 * @author : DongZeJian
 * @date : 2021-12-31 17:46
 **/
@Configuration
public class FeignConfig {

    @Bean
    @Primary
    @Scope("prototype")
    public Encoder multipartFormEncoder() {
        return new SpringFormEncoder();
    }

    @Bean
    public feign.Logger.Level multipartLoggerLevel() {
        return feign.Logger.Level.BASIC;
    }

    @Bean
    Logger feignLogger() {
        return new MyFeignLogger();
    }
}
